home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_olv_commie_grid.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
11KB
|
373 lines
# Jones 3D Cog Script
#
# OLV_Commie_Grid.cog
#
# Cog to control the AI and patrol behavior of the commies in the Olmec Valley
#
#
# [JM]
#
# (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ========================================================================================
symbols
# ========================================================================================
message startup
message crossed
message entered
message user0
# ========================== SUBROUTINES ===========================
flex MakeGrid local
flex CommiesEnter local
flex EnableAI local
flex DisableAI local
flex HuntPlayer local
# ======================= MISC LOCAL VARIABLES ===================
int counter local
int counter2 local
int StartCheck=0 local
int check=0 local
int ActivateGrid=0 local
AI AI_Sniper=com_2Hsniper.ai local
# ========================= CONSTANTS =================================
int NUMBER_OF_WPNTS=44 local
int CLEAR_WPNTS_TOTAL=60 local
int INITIAL_DISABLED_COMMIES=11 local
int NUMBER_OF_SNIPERS=3 local
int NUMBER_OF_HUNTERS=3 local
int HUNTERS_TO_BE_TELEPORTED=2 local
int NUMBER_OF_ROAMERS=1 local
int NUMBER_OF_SLACKERS=6 local
# ====================== WORLD GEOMETRY REFERENCES ==========================
surface CommieGridOff1 LinkID=1
surface CommieGridOn1 LinkID=2
sector HuntTrigger00 LinkID=3
sector HuntTrigger01 LinkID=3
# ========================== COMMIES ================================
thing Hunter00 local #These two commies are acquired through the olv_commie_intro.cog... no references needed
thing Hunter01 local
thing Hunter02
thing Roamer00
#thing Roamer01
#thing Roamer02
thing Sniper00
thing Sniper01
thing Sniper02
thing Slacker00
thing Slacker01
thing Slacker02
thing Slacker03
thing Slacker04
thing Slacker05
#thing Slacker06
thing Teleporter0
thing Teleporter1
# ============================= COGS ===============================
cog OLV_Jag1
cog OLV_Jag2
cog OLV_Jag_Temple
# ========================== WAYPOINTS ==============================
thing TempWpnt
thing wpnt00
thing wpnt01
thing wpnt02
thing wpnt03
thing wpnt04
thing wpnt05
thing wpnt06
thing wpnt07
thing wpnt08
thing wpnt09
thing wpnt10
thing wpnt11
thing wpnt12
thing wpnt13
thing wpnt14
thing wpnt15
thing wpnt16
thing wpnt17
thing wpnt18
thing wpnt19
thing wpnt20
thing wpnt21
thing wpnt22
thing wpnt23
thing wpnt24
thing wpnt25
thing wpnt26
thing wpnt27
thing wpnt28
thing wpnt29
thing wpnt30
thing wpnt31
thing wpnt32
thing wpnt33
thing wpnt34
thing wpnt35
thing wpnt36
thing wpnt37
thing wpnt38
thing wpnt39
thing wpnt40
thing wpnt41
thing wpnt42
thing wpnt43
#the above three waypoints are over by the whipswing after the second bridge
end
# =================================================================================
# =================================== CODE ========================================
# =================================================================================
code
# =================================================================================
startup:
for(counter = 0; counter < INITIAL_DISABLED_COMMIES; counter = counter + 1)
{
SetThingFlags(Hunter02[counter], 0x80000);
}
return;
# =======================================================================================
user0:
ActivateGrid = GetParam(2);
if(ActivateGrid == 1)
{
Hunter00 = Getparam(0);
CaptureThing(Hunter00);
Hunter01 = GetParam(1);
CaptureThing(Hunter01);
}
SendMessageEx(OLV_Jag1, 27, 0, 0, 0, 0);
SendMessageEx(OLV_Jag2, 27, 0, 0, 0, 0);
SendMessageEx(OLV_Jag_Temple, 27, 0, 0, 0, 0);
StartCheck = 1;
Call MakeGrid;
Call CommiesEnter;
Call EnableAI;
return;
# ============================================================================
crossed:
if(GetSenderID() == 1)
{
Call DisableAI;
}
if(GetSenderID() == 2)
{
Call MakeGrid;
Call EnableAI;
}
return;
# ========================================================================================
entered:
if(StartCheck != 1) return;
if(check == 1) return;
if(GetSenderID() != 3) return;
check = 1;
call HuntPlayer;
return;
# ========================================================================================
MakeGrid:
for(counter = 0; counter < CLEAR_WPNTS_TOTAL; counter = counter + 1)
{
AISetWpnt(TempWpnt, counter); //Clearing any waypoints that already exist
}
for(counter = 0; counter < NUMBER_OF_WPNTS; counter = counter + 1)
{
AISetWpnt(wpnt00[counter], counter); //Assign the ghost objects to the waypoint slots
}
AIConnectWpnts(0, 1);
AIConnectWpnts(0, 2);
AIConnectWpnts(1, 3);
AIConnectWpnts(1, 4);
AIConnectWpnts(2, 5);
AIConnectWpnts(3, 4);
AIConnectWpnts(3, 5);
AIConnectWpnts(4, 6);
AIConnectWpnts(5, 6);
AIConnectWpnts(5, 7);
AIConnectWpnts(7, 8);
AIConnectWpnts(8, 9);
AIConnectWpnts(9, 10);
AIConnectWpnts(9, 11);
AIConnectWpnts(10, 11);
AIConnectWpnts(10, 13);
AIConnectWpnts(11, 12);
AIConnectWpnts(11, 13);
AIConnectWpnts(11, 14);
AIConnectWpnts(13, 15);
AIConnectWpnts(14, 15);
AIConnectWpnts(14, 16);
AIConnectWpnts(15, 16);
AIConnectWpnts(16, 17);
AIConnectWpnts(17, 18);
AIConnectWpnts(18, 19);
AIConnectWpnts(18, 22);
AIConnectWpnts(19, 20);
AIConnectWpnts(19, 21);
AIConnectWpnts(20, 21);
AIConnectWpnts(21, 23);
AIConnectWpnts(21, 22);
AIConnectWpnts(22, 24);
AIConnectWpnts(23, 25);
AIConnectWpnts(24, 25);
AIConnectWpnts(25, 26);
AIConnectWpnts(26, 27);
AIConnectWpnts(27, 28);
AIConnectWpnts(28, 29);
AIConnectWpnts(29, 30);
AIConnectWpnts(12, 32);
AIConnectWpnts(32, 33);
AIConnectWpnts(33, 34);
AIConnectWpnts(34, 35);
AIConnectWpnts(35, 36);
AIConnectWpnts(36, 37);
AIConnectWpnts(37, 38);
AIConnectWpnts(37, 39);
AIConnectWpnts(39, 40);
AIConnectWpnts(41, 42);
return;
# =================================================================================
//Starts and sets all of the various instincts for the commies.
CommiesEnter:
for(counter = 0; counter < NUMBER_OF_HUNTERS; counter = counter + 1)
{
ClearThingFlags(Hunter00[counter], 0x80000);
}
for(counter = 0; counter < NUMBER_OF_ROAMERS; counter = counter + 1)
{
ClearThingFlags(Roamer00[counter], 0x80000);
}
for(counter = 0; counter < NUMBER_OF_SNIPERS; counter = counter + 1)
{
ClearThingFlags(Sniper00[counter], 0x80000);
AISetClass(Sniper00[counter], AI_sniper);
}
for(counter = 0; counter < NUMBER_OF_SLACKERS; counter = counter + 1)
{
ClearThingFlags(Slacker00[counter], 0x80000);
}
return;
# ================================================================================
EnableAI:
for(counter = 0; counter < NUMBER_OF_HUNTERS; counter = counter + 1)
{
AISetInstinctWpntMode(Hunter00[counter]);
AIEnableInstinct(Hunter00[counter], "roam", 1);
}
for(counter = 0; counter < NUMBER_OF_ROAMERS; counter = counter + 1)
{
AIEnableInstinct(Roamer00[counter], "roam", 1);
AISetInstinctWpntMode(Roamer00[counter]);
}
for(counter = 0; counter < NUMBER_OF_SLACKERS; counter = counter + 1)
{
AISetInstinctWpntMode(Slacker00[counter]);
}
return;
# ====================================================================================
DisableAI:
for(counter = 0; counter < NUMBER_OF_HUNTERS; counter = counter + 1)
{
AIClearInstinctWpntMode(Hunter00[counter]);
AIEnableInstinct(Hunter00[counter], "roam", 0);
}
for(counter = 0; counter < NUMBER_OF_ROAMERS; counter = counter + 1)
{
AIEnableInstinct(Roamer00[counter], "roam", 0);
AIClearInstinctWpntMode(Roamer00[counter]);
}
for(counter = 0; counter < NUMBER_OF_SLACKERS; counter = counter + 1)
{
AIClearInstinctWpntMode(Slacker00[counter]);
}
return;
# ========================================================================================
HuntPlayer:
for(counter = 0; counter < NUMBER_OF_HUNTERS; counter = counter + 1)
{
if(counter < HUNTERS_TO_BE_TELEPORTED)
{
TeleportThing(Hunter00[counter], Teleporter0[counter]);
}
AIWpntHuntTarget(Hunter00[counter], 2.5, 0.0);
}
return;
# ========================================================================================
end
# ========================================================================================